<template>
  <div class="box">
    <bgBox>
      <sectionTitle title="企业类型"></sectionTitle>
      <div class="echartsContent">
        <!-- <barEcharts/> -->
        <labelBox v-for="(item,index) in list" :key="index" :label="item.name" :value="item.value"  @titleClick="titleClick"/>
      </div>
    </bgBox>
  </div>
</template>

<script setup lang="ts">
import bgBox from '../components/bgBox.vue'
import sectionTitle from '../components/sectionTitle.vue'
import labelBox from '../components/labelBox.vue'
import barEcharts from '../components/barEcharts.vue'
import { currentGET } from "@/api";
import { PopupType } from '../../index.d'
import { inject } from 'vue'
import { ref, reactive } from "vue";
const showPopup = inject('showPopup') as (data: PopupType) => void;
/**
 * 获取列表点击事件
 */
const titleClick = (item: Object) => {
  console.log(item)
    showPopup({ type: 21, show: true, popupFlag: 'enterpriseList', searchInfo: {enterpriseType: item.name }})
    // showPopup({ type: 5, show: true, popupFlag: 'info', })
}

const list = ref([]);
const getData = () => {
  currentGET("enterpriseType").then((res) => {
    console.log(res);
    if (res.success) {
      list.value = res.data.list;
    }
  });
};
getData();
</script>

<style scoped lang="less">
.box {
  height: 200px;
  .echartsContent {
    display: flex;
    flex-direction: row;
    height: 150px;
  }

}
</style>
